export default {
	data() {
		return {
			showData: [],
			opts: {
				// 标记
				dotSize: 12, // 大小
				dotRadius: '50%', // 圆角
				dotColor: '#21CE7F', // 颜色
				// 连线
				lineSize: 2, // 大小
				lineColor: '#EBEDEE', // 颜色
			},
		}
	},
	props: {
		// 数据
		data: Array,
    // steps距离顶部的距离
    stepTop: {
      type: Number,
      default: 20
    },
    // step参数
    stepOpts: {
      type: Object,
      default: () => {
				return {};
			}
    },
	},
  watch: {
    data: {
      handler(val) {
				if (this.data.length > 0) {
					this.initData();
				}
      },
      deep: true,
      immediate: true
    },
  },
	mounted() {
	},
	methods: {
		initData(){
			const showData = [];
			this.data.forEach((item) => {
				const temp = JSON.parse(JSON.stringify(item));
				temp.elHeight = 0;
				showData.push(temp);
			});
			this.showData = showData;
			for (let key in this.stepOpts) {
				this.opts[key] = this.stepOpts[key];
			}
		},
	}
}
